// pages/management/record/index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    goodsImg: [],
    indexd: 0
  },
  selecd: function (e) {
    let indexto = e.currentTarget.dataset.index
    let superiorid = parseInt(e.currentTarget.dataset.id)
    if (superiorid == 1000) {

    } else if (superiorid == 2000) {

    } else if (superiorid == 3000) {
      switch (indexto) {
        case 0:
          wx.navigateTo({
            url: '/pages/management/particulars/index?indexto=' + indexto,
          })
          break;
          case 1:
          wx.navigateTo({
            url: '/pages/management/particulars/index?indexto=' + indexto,
          })
          break;
        case 2:
          wx.navigateTo({
            // url: '/pages/management/particulars/index',
          })
          break;
        case 3:
          wx.navigateTo({
            // url: '/pages/management/particulars/index',
          })
          break;
        case 4:
          wx.navigateTo({
            // url: '/pages/management/particulars/index',
          })
          break;
        case 5:
          wx.navigateTo({
            // url: '/pages/management/particulars/index',
          })
          break;
      }
    } else if (superiorid == 4000) {

    } else if (superiorid == 5000) {

    } else if (superiorid == 6000) {

    } else {

    }
  
    console.log(indexto)
    console.log(superiorid)
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    let id = parseInt(options.indextof)
    let that = this
    switch (id) {
      case 0:
        wx.setNavigationBarTitle({
          title: '档案管理'
        })
        let goodsImg1 = wx.getStorageSync("goodsImg1")
        that.setData({
          goodsImg: goodsImg1
        })
        break;
      case 1:
        wx.setNavigationBarTitle({
          title: '新品管理'
        })
        let goodsImg2 = wx.getStorageSync("goodsImg2")
        that.setData({
          goodsImg: goodsImg2
        })
        break;
      case 2:
        wx.setNavigationBarTitle({
          title: '采购管理'
        })
        let goodsImg3 = wx.getStorageSync("goodsImg3")
        that.setData({
          goodsImg: goodsImg3
        })
        break;
      case 3:
        wx.setNavigationBarTitle({
          title: '批发管理'
        })
        let goodsImg4 = wx.getStorageSync("goodsImg4")
        that.setData({
          goodsImg: goodsImg4
        })
        break;
      case 4:
        wx.setNavigationBarTitle({
          title: '订货管理'
        })
        let goodsImg7 = wx.getStorageSync("goodsImg7")
        that.setData({
          goodsImg: goodsImg7
        })
        break;
      // case 5:
      //   wx.setNavigationBarTitle({
      //     title: '库存管理'
      //   })
      //   let goodsImg5 = wx.getStorageSync("goodsImg5")
      //   that.setData({
      //     goodsImg: goodsImg5
      //   })
      //   break;
      case 5:
        wx.setNavigationBarTitle({
          title: '系统管理'
        })
        let goodsImg6 = wx.getStorageSync("goodsImg6")
        console.log(goodsImg6)
        that.setData({
          goodsImg: goodsImg6
        })
        break;
    }
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})